$(function () {
    //初始化定位我的账户
    $('section.u-c-menu-list a').each(function(index, value) {
        value = $(value);
        var urls =location.href;
        if(urls.indexOf('/web/uc/op/myCoupon')!=-1||urls.indexOf('/web/uc/op/myGiftCard')!=-1||
            urls.indexOf('/web/uc/myAccount')!=-1||urls.indexOf('/web/uc/myInteger')!=-1||
            urls.indexOf('/web/uc/myMember')!=-1 || urls.indexOf('/web/uc/account/myCash')!=-1){
            if (value.attr('href').indexOf("/web/uc/myAccount")!=-1) {
                value.parent().addClass('active').siblings().removeClass('active');
            }
        }
    });
    topNavigation();
});

function topNavigation() {
    $('section.c-info-tab h4').click(function () {
        $(this).addClass('active').siblings().removeClass('active');
        var id =$(this).data('id');
        if(id=='myGiftCard'){
            window.location.href =baseloaction+"/web/uc/op/myGiftCard";
        }else if(id=='myCoupon'){
            window.location.href =baseloaction+"/web/uc/op/myCoupon";
        }else if(id=='accountBalance'){
            window.location.href =baseloaction+'/web/uc/myAccount';
        }else if(id=='myInteger'){
            window.location.href =baseloaction+'/web/uc/myInteger';
        }else if(id=='myMembers'){
            window.location.href =baseloaction+'/web/uc/myMember';
        }else if(id=='myCash') {
            window.location.href =baseloaction+'/web/uc/account/myCash';
        }
    });
}



